﻿using System.ComponentModel.DataAnnotations;

namespace Entity.PointsActivety;

/// <summary>
/// 排队免单活动
/// </summary>
public class PointsActivity : BaseEntity
{
    /// <summary>
    /// 商户编号
    /// </summary>
    public int StoreId { get; set; }

    /// <summary>
    /// 活动名称
    /// </summary>
    [Required(ErrorMessage = "请输入活动名称")]
    public string Name { get; set; } = "";

    /// <summary>
    /// 商品图
    /// </summary>
    [SugarColumn(IsJson = true, ColumnDataType = "text")]
    public string[]? Images { get; set; }

    /// <summary>
    /// 活动描述
    /// </summary>
    [Required(ErrorMessage = "请输入活动描述")]
    public string Description { get; set; } = "";

    /// <summary>
    /// 分佣比例 如3-7分
    /// </summary>
    [Required(ErrorMessage = "请选择分佣比例")]
    public string RadioName { get; set; } = "";

    /// <summary>
    /// 进入资金池的比例 如0.3
    /// </summary>
    [Required(ErrorMessage = "请输入分佣比例")]
    [Range(minimum: 0.1, maximum: 0.9, ErrorMessage = "分佣比例最小0.1 最大0.9")]
    public decimal Radio { get; set; }

    /// <summary>
    /// 活动状态
    /// </summary>
    public PointsActivityStatus Status { get; set; } = PointsActivityStatus.进行中;

    /// <summary>
    /// 是否支持线上提现
    /// </summary>
    public bool OnlineCash { get; set; } = false;

    /// <summary>
    /// 是否半价
    /// </summary>
    public bool HalfPrice { get; set; } = false;

    /// <summary>
    /// 奖池累计金额
    /// </summary>
    public decimal TotalPrice { get; set; } = 0;

    /// <summary>
    /// 奖池当前剩余金额
    /// </summary>
    public decimal CurrentPrice { get; set; } = 0;

    /// <summary>
    /// 当前排队序号
    /// </summary>
    public int Index { get; set; } = 1;
}

/// <summary>
/// 
/// </summary>
public enum PointsActivityStatus
{
    已结束,
    进行中
}

